<template>
  <div class="bg-fff pd-10">
    <div class="top">
      <el-radio-group v-model="orderType">
        <el-radio-button :label="item.value" v-for="item in $dict.offerTypes" :key="item.value">{{item.label}}
        </el-radio-button>
      </el-radio-group>
      <em class="fx-1"></em>
      <el-checkbox v-model="isCard" label="卡片模式" border></el-checkbox>
    </div>
    <div class="panel">
      <v-bill-card-offer-list v-if="isCard" :bills="bills"></v-bill-card-offer-list>
      <div v-else>
        <el-table
          :data="bills"
          stripe
          style="width: 100%">
          <el-table-column
            type="selection"
            width="55">
          </el-table-column>
          <el-table-column
            prop="no"
            label="票据编号">
          </el-table-column>
          <el-table-column
            prop="amount"
            label="票面金额">
          </el-table-column>
          <el-table-column
            label="到期日">
            <template slot-scope="scope">
              {{$utils.toTimeFormat(scope.row.date)}}
            </template>
          </el-table-column>
          <el-table-column
            prop="amount"
            label="期望价格">
          </el-table-column>
          <el-table-column
            label="最优意向贴现率">
          </el-table-column>
          <el-table-column
            label="最优转让额">
          </el-table-column>
          <el-table-column
            label="票据状态">
            <template slot-scope="scope">
              {{scope.row.billStatus}}
            </template>
          </el-table-column>
          <el-table-column
            label="操作">
            <template slot-scope="scope">
              <el-button type="text">撤回</el-button>
              <el-button type="text">详情</el-button>
            </template>
          </el-table-column>
        </el-table>
        <div class="operation">
          <el-button size="small" type="info">批量查价</el-button>
          <el-button size="small" type="danger">批量删除</el-button>
        </div>
      </div>
      <el-pagination
        :current-page="1"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="total, sizes, prev, pager, next, jumper"
        :total="400">
      </el-pagination>
    </div>
  </div>
</template>

<script lang="ts">
  import { Vue, Component } from 'vue-property-decorator'
  import vBillCardOfferList from '@/components/bill-card-offer-list'

  @Component({
    components: {
      vBillCardOfferList
    }
  })
  export default class FixedPrice extends Vue {
    orderType = 0
  isCard = true
  bills = [
    {
      no: '01230012300123273897239',
      date: +new Date(),
      transType: 1,
      acceptName: '上海上海上海上海上海上海上海上海上海上海',
      amount: 9999999,
      syDate: +new Date(),
      billStatus: '掌柜已通过'
    },
    {
      no: '012300123200123273897239',
      date: +new Date(),
      transType: 1,
      acceptName: '上海上海上海上海上海上海上海上海上海上海',
      amount: 9999999,
      syDate: +new Date(),
      billStatus: '掌柜已通过',
      offers: [
        {
          date: +new Date(),
          no: '[123123]',
          part: '2.3%',
          amount: '123123万'
        },
        {
          date: +new Date(),
          no: '[123123]',
          part: '2.3%',
          amount: '123123万'
        },
        {
          date: +new Date(),
          no: '[123123]',
          part: '2.3%',
          amount: '123123万'
        }
      ]
    }
  ]
  }
</script>

<style lang="less" scoped>
  .bg-fff {
    margin-top: 10px;
  }

  .top {
    display: flex;
    padding-bottom: 20px;
  }

  .operation {
    margin-top: 20px;
  }

  .el-pagination {
    float: right;
    margin-top: 20px;
  }
</style>
